$sudo yum install npm

$npm --version

Output like this will be seen if everything has been installed properly:

3.10.10

Install solc

$sudonpm install -g solc

$solcjs-version

This will print:

0.5.2+commit.1df8f40c.Emscripten.clang

2. Docker Image

To start with Solidity programming, pull a Docker image and start

using it:

$docker pull ethereum/solc:stable

$docker run ethereum/solc:stable-version

This will print:

0.5.2+commit.1df8f40c.Linux.g++

3 . Binary Packages Installation

To install the full-fledged compiler on your Linux machine, visit the

official website installing the Solidity compiler.

Solidity syntax

Any number of contract definitions, import directives, and pragma

directives are contained in a Solidity source file.

A source file of Solidity is like:

pragma solidity > =0.4.0 < 0.6 .0;

contract SStore {

uint sD ata;

function set(uint x) public {

sD ata = x;

}

function get() public view returns (uint) {

return sD ata;

}

}